In Silverblue right now, the boot menu title looks like this:
Fedora 29.
20190301.0 (Workstation Edition) 29.
20190301.0 (ostree)
This is because RPM-OSTree's `mutate-os-release` feature is enabled,
which injects the OSTree version string directly into `VERSION` and
`PRETTY_NAME`. So appending the version string again is a bit redundant.
Let's just do a simple substring check here before adding the version to
the title.
Closes: #1829
Approved by: cgwalters
* (specifically, it looks for the substring "(ostree"), so further
* changes to the title format may require updating that backend. */
g_autoptr(GString) title_key = g_string_new (val);
- if (deployment_version && *deployment_version)
+ if (deployment_version && *deployment_version && !strstr (val, deployment_version))
{
g_string_append_c (title_key, ' ');
g_string_append (title_key, deployment_version);
set -euo pipefail
-echo "1..$((25 + ${extra_admin_tests:-0}))"
+echo "1..$((26 + ${extra_admin_tests:-0}))"
function validate_bootloader() {
cd ${test_tmpdir};
echo "ok upgrade with multiple kernel args"
+os_repository_new_commit
+${CMD_PREFIX} ostree admin upgrade --os=testos
+assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf "^title TestOS 42 ${version} (ostree:testos)$"
+os_repository_new_commit 0 0 testos/buildmaster/x86_64-runtime 42
+${CMD_PREFIX} ostree admin upgrade --os=testos
+assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf "^title TestOS 42 (ostree:testos)$"
+
+echo "ok no duplicate version strings in title"
+
+
# Test upgrade with and without --override-commit
# See https://github.com/GNOME/ostree/pull/147
${CMD_PREFIX} ostree pull --repo=sysroot/ostree/repo --commit-metadata-only --depth=-1 testos:testos/buildmaster/x86_64-runtime
boot_checksum_iteration=${1:-0}
content_iteration=${2:-0}
branch=${3:-testos/buildmaster/x86_64-runtime}
+ export version=${4:-$(date "+%Y%m%d.${content_iteration}")}
echo "BOOT ITERATION: $boot_checksum_iteration"
cd ${test_tmpdir}/osdata
kver=3.6.0
echo "content iteration ${content_iteration}" > usr/bin/content-iteration
- export version=$(date "+%Y%m%d.${content_iteration}")
-
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string "version=${version}" -b $branch -s "Build"
cd ${test_tmpdir}
}